//
//  MyUIViewController.m
//  MoCard
//
//  Created by 水石 温 on 11-10-14.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "MyUIViewController.h"
#import "MyUITableViewController.h"


@implementation MyUIViewController
#pragma mark - View lifecycle

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.view.backgroundColor = RGB(42, 47, 56, 1);
    
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                                     [UIColor whiteColor], UITextAttributeTextColor,
                                                                     nil]];

//    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
//    //imageView.backgroundColor = [UIColor redColor];
//     imageView.image = [IMG(@"background.jpg") stretchableImageWithLeftCapWidth:160 topCapHeight:460];
//     [self.view addSubview:imageView];
    
    // 不支持 iOS4
    UINavigationBar *navBar = [self.navigationController navigationBar];
    if ([navBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)]) {
        if (IOS7_OR_LATER) {
            [navBar setBackgroundImage:IMG(@"navi_bar_iphone5.png") forBarMetrics:0];
        }else{
            [navBar setBackgroundImage:IMG(@"navi_bar.png") forBarMetrics:0];
        }
    }
    [Global SetSubViewExternNone:self];
    
    NSInteger vcCount = [self.navigationController.viewControllers count];
   
    if (vcCount==1) {
        UIBarButtonItem *leftItem = [MyUITableViewController leftMenuBarButtonItem];
        self.navigationItem.leftBarButtonItem=leftItem;
    }
    
}
//-(void)cancel{
//    if (!self.navigationController.presentedViewController) {
//        [self.navigationController popViewControllerAnimated:YES];
//    }
//}

-(void)dealloc {
}


@end
